public class Math {
    //获取前n像斐波那契数
    public static int[] math(int n) {
        if (n <= 0) {
            return null;
        }

        int[] array = new int[n];
        array[0] = array[1] = 1;
        for (int i = 2; i < n; ++i) {
            array[i] = array[i - 1] + array[i - 2];
        }

        return array;
    }

    public static void main(String[] args) {
        int[] array = math(10);
        for (int i = 0; i < array.length; i++) {
            System.out.println(array[i]);
        }
    }
}
